home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7424 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Constructor classes
  5. Date: 23 Feb 1996 08:27:56 GMT
  6. Organization: self-employed
  7. Message-ID: <4gjtqc$45a@news.bridge.net>
  8. References: <4gi8es$4gn@daily-planet.execpc.com>
  9. NNTP-Posting-Host: ppp-mia1-45.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16.  
  17. >> How do I access the array's data members?  I have tried:
  18. >>     m_itema[0], ContainerClass->m_itema[0], 
  19. >> ContainerClass.m_itema[0], OtherClass->m_itema[0]. 
  20. >> OtherClass.m_itema[0], etc. etc.
  21.  
  22.   You are confusing classes with objects.
  23.  
  24.   A class is a "type of thing". An object is an actual thing.
  25.  
  26.   Does this code make sense?
  27.  
  28.  
  29.       ContainerClass aContainer ;    // declare an object
  30.  
  31.  
  32.          aContainer.Items[0].m_itema[0]
  33.  
  34.  The above expression refers to one char within the container. 
  35. However, you can't actually write except where you have access to the 
  36. private parts of OtherClass.
  37.  
  38.  
  39.                      David
  40.  
  41.  
  42.